import 'package:love_app/common/su_dio.dart';
import 'package:love_app/config/path_url.dart';
import 'package:love_app/model/from_token_model.dart';
import 'package:love_app/model/response_model.dart';

class FormTokenApi{
    // 获取防止重复表单的token
  Future<String> getFormToken(String token) async {
    Map headers = {
      'X-Auth-Token': token,
    };
    String path = PathUrl.getFormToekn;
    ResponseModel responseModel =
        await SuDio().getRequest(path, headersMap: headers);
    FromTokenModel fromTokenModel =
        FromTokenModel.fromJson(responseModel.toJsonModel);
    return fromTokenModel.data.formToken;
  }
}